<template>
  <div>
      <el-card class="box-card">

        <div slot="header" class="clearfix">
            <span>评论</span>
        </div>

        <div class="text item">
            <el-table :data="commentObj.list" style="width: 100%">
                <el-table-column prop="comment" label="" width="180"></el-table-column>
                <el-table-column prop="like" label="" width="180">
                    <icon><img src=""></icon>
                </el-table-column>           
            </el-table>

            <el-pagination
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
            :current-page="pagination.current"
            :page-sizes="[5,10,15,20]"
            :page-size="pagination.size"
            layout="total, sizes, prev, pager, next, jumper"
            :total="pagination.total">
            </el-pagination>

        </div>

      </el-card>

  </div>
</template>

<script>
import {mapState,mapMutations,mapActions} from "vuex"
export default {
    computed:{
        ...mapState("comment",['commentObj',"pagination"]) //接收（导入）状态（全局数据）
    },

    data () {
        return {
            
        }
    },

    methods: {
        ...mapActions("comment",["setComment"]),

        handleCurrentChange(pageNO,size){
            this.setComment({pageNO,size});
        },
        handleSizeChange(size){
            this.setComment({pageNO:this.pagination.current,size})
        },

    },

    create() {
        this.setComment();
    }

}
</script>

<style>

</style>